import 'package:flutter/material.dart';
 
class MyImage extends StatefulWidget {
  final String imageName;
  final BoxFit? boxFit;
  final double? width;
  final double? height;

  const MyImage({super.key, required this.imageName, this.boxFit, this.width, this.height});

  @override
  State<MyImage> createState() => _MyImageState();
}

class _MyImageState extends State<MyImage> {
  @override
  Widget build(BuildContext context) {
    return Image.asset(
      'assets/images/${widget.imageName}.png',
      width: widget.width ??  widget.height,
      height: widget.height ?? widget.width,
    );
  }
}
